#include <iostream>
using namespace std;
struct t{
	int x,y;
};
int num=0;
int up=0,down=0,le=0,r=0;
t src[100000];
void output();
int main()
{
	int m,n;
	
	cin>>m>>n;
	while(1){
		if(m==0&&n==0) break;
		src[num].x=m;
		src[num].y=n;
		num++;
		cin>>m>>n;
		if(m==0&&n==0){
			output();
			cin>>m>>n;
		}
		else continue;
	}
	
}

void output()
{
	le=r=src[0].x;
	up=down=src[0].y;
	for(int i=0;i<num;i++){
		if(src[i].x<le){
			le=src[i].x;
			//continue;
		} 
		if(src[i].x>r){
			r=src[i].x;
			//continue;
		}
		if(src[i].y>up){
			up=src[i].y;
			//continue;
		}
		if(src[i].y<down){
			down=src[i].y;
			//continue;
		}
	}
	cout<<le<<" "<<down<<" "<<r<<" "<<up<<endl;
	num=0;
}
